package com.blb.edupayservice.feign;

import com.blb.common.entity.Course;
import com.blb.common.entity.CourseActivity;
import com.blb.common.util.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 调用课程服务接口
 */
@FeignClient("edu-course-service")
public interface CourseServiceFeignClient {

    /**
     * 给活动库存加1
     * @param activityId
     * @return
     */
    @RequestMapping("/course-activity/addStock")
    ResponseResult<CourseActivity> addStock(@RequestBody Long activityId);

    /**
     * 给活动库存减一
     * @param activityId
     * @return
     */
    @RequestMapping("/course-activity/reduceStock")
    ResponseResult<CourseActivity> reduceStock(@RequestBody Long activityId);

    /**
     * 增加课程销量
     * @param id
     * @return
     */
    @RequestMapping("/course/sales")
    Course addCourseSales(@RequestBody  Long id);
}
